import React, {Component} from 'react';
import {withRouter} from 'react-router-dom';
import {Link} from "react-router-dom";
import './style/homeheader.less';
class HomeHeader extends Component{
    // constructor(props){
    //     super(props);
    // }
    backToHome = ()=>{
      this.props.history.push('/home');
    };

    logout = ()=>{
        sessionStorage.setItem("loginStatus","Logout");
        this.props.history.push('/');
    }

    render(){
        return(
           <div className="header">
               <img title={"回到首页"} onClick={this.backToHome} className={"header-logo"} src={require('../../../public/img/phonograph.png')} alt={""}/>
               <Link className={"header-topMenu"} to={{pathname:`/`}}>首页</Link>
               <Link className={"header-topMenu"} to={{pathname:`/phonograph`}}>录音</Link>
               <Link className={"header-topMenu"} to={{pathname:`/recList`}}>列表</Link>
               <Link className={"header-topMenu2"} to={{pathname:`/tableList`}}>表格列表</Link>
               <Link className={"header-topMenu2"} to={{pathname:`/tableFieldList`}}>表格列表</Link>
               <Link className={"header-topMenu"} to={{pathname:`/carousel`}}>轮播</Link>
               <Link className={"header-topMenu2"} to={{pathname:`/Inquiry`}}>关于爱情</Link>
               <div className={"header-login"}  onClick = {this.logout}>退出登录</div>
           </div>
        )
    }
}
export default (withRouter(HomeHeader));
